package algorithm

import (
	"fmt"
	"github.com/tjfoc/gmsm/x509"
	"svs/service/algorithm/parse_cert"
)

type SM2 struct {
}

func NewSm2() *SM2 {
	return &SM2{}
}

func (s *SM2) ExportCert(id string) {
	fmt.Println("id" + id)
}

func (s *SM2) ParseCert(certId int, cert string) {
	parseCertHandler := make(map[int]parse_cert.ParseCertI)
	parseCertHandler[0x00000001] = &parse_cert.CertVersion{}
	parseCertHandler[certId].PrintInfo(cert)
}

func (s *SM2) ValidateCert() {

}
func (s *SM2) SignData() {

}
func (s *SM2) VerifySignedData() {

}
func (s *SM2) SignDataInit() {

}
func (s *SM2) SignDataUpdate() {

}
func (s *SM2) SignDataFinal() {

}
func (s *SM2) VerifySignedDataInit() {

}
func (s *SM2) VerifySignedDataUpdate() {

}
func (s *SM2) VerifySignedDataFinal() {

}
func (s *SM2) SignMessage() {

}
func (s *SM2) VerifySignedMessage() {

}
func (s *SM2) SignMessageInit() {

}
func (s *SM2) SignMessageUpdate() {

}

func (s *SM2) SignMessageFinal() {

}
func (s *SM2) VerifySignedMessageInit() {

}
func (s *SM2) VerifySignedMessageUpdate() {

}
func (s *SM2) VerifySignedMessageFinal() {

}

func (s *SM2) GenP10(key []byte) {
	temp := x509.Certificate{}
	priKey, _ := x509.ReadPrivateKeyFromPem(key, nil)
	x509.CreateCertificateToPem(&temp, &temp, &priKey.PublicKey, priKey)
}
